#include <iostream>
#include<string>
#include<algorithm>
using namespace std;

int main() {
    //string s1;
    //string s2 = " ";
    //size_t size_pos = 0;
    //size_t size_prev_pos = 0;
    //getline(cin, s1);
    //while ((size_pos = s1.find_first_of(s2, size_pos)) != string::npos)
    //{
    //    size_prev_pos = ++size_pos;
    //}

    //string s3 = s1.substr(size_prev_pos);
    //cout << s3.size() << endl;

    string s = "0P";
    transform(s.begin(), s.end(), s.begin(), ::tolower);
    string s2;
    int n = s.size();
    for (int i = 0; i < n; i++)
    {
        if (s[i] >= 'a' && s[i] <= 'z')
        {
            s2 += s[i];
        }
    }
    string s3;
    for (string::reverse_iterator rit = s2.rbegin(); rit != s2.rend(); ++rit)
    {
        s3 += *rit;
    }
    if (s2 == s3)
    {
        cout << 1 << endl;
    }

    return 0;
}